package com.lz.service;

import com.lz.entity.QDept;
import com.lz.repository.DeptJpaRepository;
import com.lz.repository.EmpJpaRepository;
import com.lz.repository.SalGradeJpaRepository;
import com.querydsl.jpa.impl.JPAQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;

/**
 * EmpServiceImpl..
 *
 * @author Lizhong
 * @date 2020/5/7
 */
@Service
public class EmpServiceImpl implements EmpService {
    @Autowired
    private DeptJpaRepository deptJpaRepository;

    @Autowired
    EmpJpaRepository empJpaRepository;

    @Autowired
    SalGradeJpaRepository salGradeJpaRepository;

    @Autowired
    EntityManager entityManager;


    // @Inject
    // SQLQueryFactory queryFactory;

    @Override
    public void method01(){
        // where entityManager is a JPA EntityManager
        JPAQuery<?> query = new JPAQuery<Void>(entityManager);
        QDept dept = QDept.dept;

    }
}
